set mapToPrint to the value of item 1 of field "MaxField"
set w to printer(mGetPageWidth)
set h to printer(mGetPageheight)
set mapName to item 4 of field "maxfield"
printer(mSetMargins, 1, 1, 1, 1)
printer(mSetTextStyle, "bold,underline")
set halve to printer(mGetPaperWidth) / 2
printer(mSetTextSize, 24)
printer(mSetTextJust, "centered")
printer(mdrawText, mapName, halve, 40)
printer(mNewPage)
if item 5 of field "MaxField" = "metro" then
AppendBitMap(mapToPrint, 1, 55, "metro")
else
AppendBitMap(mapToPrint, 1, 55, "map")
end if
if item 2 of field "MaxField" > -1 then
set arrowx to the value of item 2 of field "MaxField"
set arrowy to the value of item 3 of field "MaxField"
AppendBitMap("arrow", arrowx, arrowy, "arrow")
end if
printingProc()
end
on AppendBitMap TheBitMap, left, top, whatToPrint
global w, h, print, forArrowTop, forArrowLeft, prop
set y to the height of cast TheBitMap
set x to the width of cast TheBitMap
if whatToPrint = "tour" then
if x > (w - 5) then
set x to w - 5
set y to (y * w / x) + 30
end if
else
if whatToPrint = "map" then
set oldY to y
set oldX to x
set y to printer(mGetPageheight) - top - 60
set x to (oldX * y / oldY) + 0.0
set prop to y / (oldY + 0.0)
set left to (printer(mGetPageWidth) / 2.0) - (x / 2.0)
set x to left + x
set y to top + y
set forArrowTop to top
set forArrowLeft to left
set left to integer(left)
set x to integer(x)
else
if whatToPrint = "metro" then
set oldY to y
set oldX to x
set x to printer(mGetPageWidth)
set y to (oldY * x / oldX) + 0.0
set prop to x / (oldX + 0.0)
set top to (printer(mGetPageheight) / 2.0) - (y / 2.0)
set x to left + x
set y to top + y
set forArrowTop to top
set forArrowLeft to left
set top to integer(top)
set y to integer(y)
else
if whatToPrint = "arrow" then
set left to left * prop
set top to top * prop
if item 5 of field "MaxField" = "metro" then
end if
set left to integer(left - (x / 2) + forArrowLeft)
set top to integer(top - y + forArrowTop)
set top to top - 7
set x to integer(left + x)
set y to integer(top + y)
end if
end if
end if
end if
printer(mPicture, the picture of member TheBitMap, left, top, x, y)
if whatToPrint = "tour" then
end if
end
on printText
global w, h, gPropFont, printer
printer(mSetMargins, 72, 72, 72, 72)
set w to printer(mGetPageWidth)
set h to printer(mGetPageheight)
MySetUp()
printer(mNewPage)
printer(mTextBox, 22, 42, w, h, 0)
repeat with cnt = 1 to the number of lines in field "MaxField"
set CastToPrint to integer(the value of item 1 of line cnt of field "Maxfield")
AppendStyledText(printer, CastToPrint, 1)
end repeat
printingProc()
end
on printTour
global printer
set w to printer(mGetPageWidth)
set h to printer(mGetPageheight)
MySetUp()
printer(mNewPage)
set mapName to line 1 of field "maxfield"
printer(mSetMargins, 1, 1, 1, 1)
printer(mSetTextStyle, "bold,underline")
set halve to printer(mGetPaperWidth) / 2
printer(mSetTextSize, 24)
printer(mSetTextJust, "left")
printer(mdrawText, mapName, 35, 55)
set whatToPrint to "tour"
set TheBitMap to the value of line 2 of field "MaxField"
AppendBitMap(TheBitMap, 235, 70, "tour")
printer(mSetTextJust, "left")
printer(mSetTextStyle, "plain")
printer(mTextBox, 35, 60, w, h, 1)
printer(mSetTextSize, 16)
repeat with i = 3 to the number of lines in field "MaxField"
set tourtext to line i of field "MaxField"
AppendStyledText(printer, the value of tourtext, 1)
end repeat
printingProc()
end
on MySetUp
global printer, w, h, gPropFont
printer(mSetLandScapemode, 0)
printer(mSetMargins, 72, 72, 72, 72)
set w to printer(mGetPageWidth)
set h to printer(mGetPageheight)
printer(mSetTextFont, gPropFont)
printer(mSetTextSize, 12)
printer(mSetTextStyle, "italic")
printer(mSetPageNumSymbol, "Þ")
printer(mSetTextJust, "left")
printer(mdrawText, "Cocktails", 22, 35)
printer(mSetTextJust, "right")
printer(mdrawText, "page Þ", w, 35)
printer(mLine, 22, 38, w, 38)
printer(mSetTextJust, "left")
printer(mSetTextStyle, "plain")
end
on AppendStyledText obj, theCast, autoAppend
if not objectp(obj) then
exit
end if
if not integerp(theCast) and not stringp(theCast) then
exit
end if
if not integerp(autoAppend) then
set autoAppend to 0
end if
set styleList to BuildStyleList1(theCast)
repeat with cnt = 1 to count(styleList)
set styleRun to getAt(styleList, cnt)
obj(mSetTextFont, getaProp(styleRun, #font))
obj(mSetTextSize, getaProp(styleRun, #size))
obj(mSetTextStyle, getaProp(styleRun, #style))
set charsAdded to obj(mAppendText, char getaProp(styleRun, #start) to getaProp(styleRun, #end) of field theCast, autoAppend)
if charsAdded = 0 then
exit
end if
end repeat
end
on BuildStyleList theCast
global printSource, tournumber
if printSource = "tours" then
set diff to 500
else
if printSource = "general" then
set diff to 7140
else
if printSource = "objects" then
set diff to 120
end if
end if
end if
if (the name of cast theCast = "maxspace") or (the name of cast theCast = "maxfield2") or (the name of cast theCast = "theEmpty") then
set styleList to BuildStyleList1(theCast)
else
if printSource = "tours" then
put theCast + 20
set styleList to the value of the text of cast (theCast + 20)
else
if (printSource = "objects") and (theCast > 366) then
set styleList to the value of line theCast - 366 of field "stylelists3"
else
if (printSource = "objects") and (theCast > 275) then
set styleList to the value of line theCast - 275 of field "stylelists2"
else
if (printSource = "general") and ((theCast - diff) > 35) then
set styleList to the value of line theCast - diff - 35 of field "Stylelists2"
else
set styleList to the value of line theCast - diff of field "stylelists"
end if
end if
end if
end if
end if
return styleList
end
on BuildStyleList1 theCast
set styleList to []
set curFont to EMPTY
set curSize to 0
set curStyle to EMPTY
repeat with cnt = 1 to the number of chars in the text of member theCast
if (the textFont of char cnt of field theCast <> curFont) or (the textSize of char cnt of field theCast <> curSize) or (the textStyle of char cnt of field theCast <> curStyle) then